home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
comm
/
mail
/
YAMscripts.lha
/
YAMmail.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-11-20
|
2KB
|
57 lines
/* YAMmailAWeb.rexx 1.1 by knikulai@utu.fi
Copy the script into the same directory where AWeb is and select settings
page 'Network 3: General settings' and enter the following values
'mailto: Command' sys:rexx/rx
'mailto: Arguments' YAMmailAWeb.rexx %s <-- this only works for the demo version
check your manual for version 2
*/
subject='Mail from your web page'
Options Results
parse arg email /* an adress could become useful later...*/
ports=show('P') /* What ports are there? */
parse var ports dummy 'AWEB.' portnr . /* Get a valid AWeb port */
address value 'AWEB.' || portnr
'get activeport' /* Ask AWeb which window started the script */
browser=result /* Remember the windows port */
if show('P','YAM')=0 then do /* YAM is not running yet, so let's start it */
address command 'run <>nil: yam:yam nocheck'
i=0
do until show('P','YAM')>0 | i=3 /* Let's not wait more than 30 seconds */
address command 'sys:rexxc/WaitForPort YAM'
i=i+1
end /* do */
if show('P','YAM')=0 then exit
end
/* Now we know YAM is up and running */
address 'YAM' 'Request "Do you want to include current page?" "Yes|No|Cancel"'
choice=result
/* Now we know what the user wants to do.. */
if choice='0' then exit /* User selected Cancel */
njaah=pos('?SUBJECT=',upper(email))
if njaah>0 then do
subject=right(email,length(email)-njaah-8)
email=left(email,njaah-1)
end
address 'YAM' /* The following commands are sent to YAM */
'Show' /* Uniconify */
'MailWrite' /* Press 'Write'-button */
'WriteMailTo "'||email||'"' /* Set address */
'WriteSubject "'||subject||'"' /* Set subject */
if choice='1' then do /* Include current page */
address value browser /* Send next line to current AWeb window */
'saveas t:foo' /* Ask AWeb to save current page to a file */
address 'YAM' 'WriteLetter "t:foo"' /* Insert file into letter */
address command 'delete <>nil: t:foo' /* delete file */
end
exit